namespace Client.star
{
    enum StarType { O, B, A, F, G, K, M, L, T } // L and T are small, cool dwarfs not set in the StarMap.MakeStar()
    enum StarColor { blue, purple, white, yellowish_white, yellow, orange, red, brown, redGiant, redSuperGiant }
    enum StarAge { young, average, old, ancient, atMainSeqLifePeriodEnd }
    enum PostMainSeq { WhiteDwarf, BlackDwarf, NeutronStar, Pulsar, PlanetaryNebula, BlackHole }
    enum LuminosityType
    {
        Ia0,
        Ia, Iab, Ib,
        IIa, IIab, IIb,
        IIIa, IIIab, IIIb,
        IVa, IVab, IVb,
        Va, Vab, Vb,
        VI,
        VII
    }

    struct MinMaxMass
    {
        public MinMaxMass(double min, double max)
        {
            this.min = min;
            this.max = max;
        }

        #region Properties
        public double Min
        {
            get { return min; }
        }
        public double Max
        {
            get { return max; }
        }
        #endregion

        double min;
        double max;
    }

    struct StarClass
    {
        public StarClass(StarType starType, StarColor starColor)
        {
            this.starType = starType;
            this.starColor = starColor;
        }

        #region Properties
		internal StarType StarType
        {
            get { return starType; }
            set { starType = value; }
        }
        internal StarColor StarColor
        {
            get { return starColor; }
            set { starColor = value; }
        } 
	#endregion

        StarType starType;
        StarColor starColor;
    }
    
    struct LuminosityClass
    {
        public LuminosityClass(LuminosityType luminosityType, string lumStarDesc)
        {
            this.luminosityType = luminosityType;
            this.lumStarDesc = lumStarDesc;
        }

        #region Properties
		internal LuminosityType LuminosityType
        {
            get { return luminosityType; }
        }
        public string LumStarDesc
        {
            get { return lumStarDesc; }
        } 
	    #endregion

        LuminosityType luminosityType;
        string lumStarDesc;
    }

    static class MakeStar
    {
        public static StarClass[] starClass = 
        {
            new StarClass(StarType.O, StarColor.blue),
            new StarClass(StarType.B, StarColor.purple),
            new StarClass(StarType.A, StarColor.white),
            new StarClass(StarType.F, StarColor.yellowish_white),
            new StarClass(StarType.G, StarColor.yellow),
            new StarClass(StarType.K, StarColor.orange),
            new StarClass(StarType.M, StarColor.red),
            new StarClass(StarType.L, StarColor.brown),
            new StarClass(StarType.T, StarColor.brown)
        };

        public static LuminosityClass[] luminosityClass = 
        {
            new LuminosityClass(LuminosityType.Ia0, "Hypergiant"),
            new LuminosityClass(LuminosityType.Ia, "Luminous supergiant"),
            new LuminosityClass(LuminosityType.Iab, "Intermediate luminous supergiant"),
            new LuminosityClass(LuminosityType.Ib, "Less luminous supergiant"),
            new LuminosityClass(LuminosityType.IIa, "Bright giant"),
            new LuminosityClass(LuminosityType.IIab, "Intermediate bright giant"),
            new LuminosityClass(LuminosityType.IIb, "Less bright giant"),
            new LuminosityClass(LuminosityType.IIIa, "Normal giant"),
            new LuminosityClass(LuminosityType.IIIab, "Intermediate luminous normal giant"),
            new LuminosityClass(LuminosityType.IIIb, "Less luminous normal giant"),
            new LuminosityClass(LuminosityType.IVa, "Subgiant"),
            new LuminosityClass(LuminosityType.IVab, "Intermediate luminous subgiant"),
            new LuminosityClass(LuminosityType.IVb, "Less luminous subgiant"),
            new LuminosityClass(LuminosityType.Va, "Main sequence star(dwarf)"),
            new LuminosityClass(LuminosityType.Vab, "Intermediate luminous main sequence star(dwarf)"),
            new LuminosityClass(LuminosityType.Vb, "Less luminous main sequence star(dwarf)"),
            new LuminosityClass(LuminosityType.VI, "Subdwarf"),
            new LuminosityClass(LuminosityType.VII, "White dwarf")
        };

        public static MinMaxMass[] minMaxMass =
        {
            new MinMaxMass(16, 158),
            new MinMaxMass(2.6, 16),
            new MinMaxMass(1.6, 2.6),
            new MinMaxMass(1.08, 1.6),
            new MinMaxMass(0.83, 1.08),
            new MinMaxMass(0.47, 0.83),
            new MinMaxMass(0.08, 0.47),
            new MinMaxMass(0.04, 0.08),
            new MinMaxMass(0.01, 0.04),
        };
    }
}
